const http = require("http")
const fs = require("fs")
const path = require("path")

http.createServer((req,res)=>{
    if(req.url =='/'){
        var filePath = path.join(__dirname,"/rest.html");
        var fileContent = fs.readFileSync(filePath);
        res.writeHead(200,{"Content-Type":"text/html;charset=utf8"})
        res.write(fileContent);
        res.end();
    }
}).listen(8081);

//先运行static-server.js 后运行data-server.js